package com.hlx.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ChatPdfMapper {
	/**
	 * 保存pdf文件和会话id联系
	 * @param chatId
	 * @param url
	 */
	@Insert("insert into chat_pdf(chat_id, pdf_path) values(#{chatId}, #{url})")
	void save(String chatId, String url);

	/**
	 * 获取pdf文件
	 * @param chatId
	 * @return
	 */
	@Select("select pdf_path from chat_pdf where chat_id = #{chatId} limit 1")
	String getFile(String chatId);
}
